﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SharpWeb
{
    /// <summary>
    /// Combobox组件
    /// </summary>
    public class ComboBox : SelectTag
    { 

        /// <summary>
        /// ref所指向的是当前combox值改变引起联动的下一级combox的Id
        /// </summary>
        public string @ref
        {
            get { return this.Attributes["ref"]; }
            set { this.Attributes["ref"] = value; }
        }

        /// <summary>
        /// 此url返回下级联动所需的json数据
        /// </summary>
        /// <remarks>服务器端返回json格式： 
        ///[ 
        ///      ["all", "所有城市"], 
        ///      ["bj", "北京市"] 
        ///] 
        /// </remarks>
        public string refUrl
        {
            get { return this.Attributes["refUrl"]; }
            set { this.Attributes["refUrl"] = value; }
        }


        protected override void InitComponent(ComponentContext context)
        {
            base.InitComponent(context);
            this.Attributes["class"] = "combox";
        }
    }
}